package org.moonlight.jvm.instructions.math.bool.and;

import org.moonlight.jvm.instructions.base.NoOperandsInstruction;
import org.moonlight.jvm.rtda.exclusive.Frame;
import org.moonlight.jvm.rtda.exclusive.OperandStack;

/**
 * LAND: 弹出 操作数栈栈顶 的两个 long型变量，进行 与运算(& - 同时为“1”，结果才为“1”，否则为0), 然后将结果压入操作数栈
 *
 * @author Moonlight
 * @createTime 2023/8/16 17:46
 **/
public class LAnd extends NoOperandsInstruction {

    @Override
    public void execute(Frame frame) {
        OperandStack stack = frame.getOperandStack();
        long a = stack.popLong();
        long b = stack.popLong();
        stack.pushLong(a & b);
    }

}
